<template>
  <div class="login-cntainer">
    <div><img src="../../images/login/0.login_02.jpg" alt="" /></div>
    <div class="vanlogin">
      <div class="login-item">
        <input type="text" v-model="loginObj.phone" placeholder="输入手机号登录">
      </div>
      <div class="login-item">
        <input type="text" v-model="loginObj.pwdcode" placeholder="输入手机验证码">
        <span>{{Codetext}}</span>
      </div>
      <van-button round type="info" @click="loginevt">立即登录</van-button>
      
      <div class="wxlogin">
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-weixin"></use>
        </svg>
        <span>微信登录</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      loginObj:{
        phone: "17323088827",
        pwdcode: "3322",
      },
      Codetext:'获取验证码'
    };
  },

  methods: {
    onSubmit(values) {
      console.log("submit", values);
    },
    loginevt() {
      if(!/^1[3-9]{1}[0-9]{9}$/.test(this.loginObj.phone)){
        this.$toast({
          message:'手机号输入错误',
          position: 'bottom'
        })
        return
      }
      if (!/^[0-9]{4}$/.test(this.loginObj.pwdcode)) {
        this.$toast({
                message: '验证码输入错误',
                position: 'bottom',
            })
        return
      }
      this.$router.push("/home");
    },
  },
};
</script>

<style lang="less">
@import "./index.less";


</style>